<!doctype html>
@extends('layouts.app')
@section('title','edit页面')

@section('content')
    <form action="{{route('people.update',$res->id)}}" method="post">
        {{csrf_field()}}
        {{method_field('PUT')}}
        <p>姓名：<input type="text" name="name" value="{{$res->name}}"></p>
        <p>国家：<input type="text" name="country" value="{{$res->country}}"></p>
        <p><input type="submit" value="提交"></p>
    </form>

    <p>评论：</p>
    @foreach($comments as $val)
    <p>{{$val->content}}</p>
    @endforeach

    <form action="{{route('comments.store')}}" method="post">
        {{csrf_field()}}
        <input type="hidden" value="{{$res->id}}" name="people_id">
        <textarea name="content"></textarea>
        <p><input type="submit" value="提交评论"></p>
    </form>
    <a href="/">回到首页</a>
@endsection
